package com.liu.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.util.HashMap;
import java.util.Map;

@RestControllerAdvice
public class GlobalExceptionHandler {


    @ExceptionHandler(ValidateException.class)
    public Map handlerValidateException(ValidateException e){
        Map map = new HashMap();
        map.put("code",0);
        map.put("msg",e.getError());
        return map;
    }


}
